package com.zzy.weixin.controller;

import com.foxinmy.weixin4j.mp.WeixinProxy;
import com.zone.weixin4j.controller.WxController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zhangzhiyi on 2017/7/14.
 */
@RestController
public class WeiXinController extends WxController{
    @Autowired
    private WeixinProxy proxy;
    @RequestMapping
    @Override
    protected void doRequest(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) String encrypt_type, @RequestParam(required = false) String echostr, @RequestParam(required = false) String timestamp, @RequestParam(required = false) String nonce,
                             @RequestParam(required = false) String signature, @RequestParam(required = false) String msg_signature, @RequestParam(required = false) String weixin_id) {
        super.processMessage(request,response,encrypt_type,echostr,timestamp,nonce,signature,msg_signature,proxy.getWeixinAccount().getId());
    }
}
